home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 24
/
AMIGAplus Sonderheft 24 (2000)(Falke)(DE)[!].iso
/
PublicDomain
/
Anwendungen
/
MT-RechnungIII
/
Rexx
/
WWÜberweisung_G.inbrexx
< prev
next >
Wrap
Text File
|
1998-08-23
|
4KB
|
167 lines
/*
** Druck-, Vorschau, Sichern der Überweisung der Rechnungssumme (Großbuchstaben) mit Hilfe von WordWorth
** $VER: WWÜberweisung.inbrexx_G V1.00 (18.08.98)
*/
PARSE ARG ARexxPort;
ADDRESS VALUE ARexxPort;
OPTIONS RESULTS;
WWVorlage = "WWDokumente/Überweisung.ww";
WWDokument = "t:Überweisung.ww";
WWPort = "WORDWORTH."
LF = '0a'x; /* Zeilenvorschub */
Gefunden = 0;
DO i = 1 TO 20 WHILE(Gefunden = 0)
IF show(ports, (WWPort || i)) THEN
DO;
Gefunden = 1;
WWPort = WWPort || i;
END;
END;
IF Gefunden = 0 THEN
DO;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "WordWorth ist nicht aktiv, bitte starten sie dieses" || LF || "und versuchen Sie es erneut";
ES_GADGETFORMAT = "Abbrechen";
EASY_REQUEST;
EXIT;
END;
/* Original WW-Dokument nach t: kopieren, um ein versehentliches überschreiben */
/* dieser Vorlage zu verhindern */
GET_REXXPATH;
WWVorlage = MTR_RESULT || WWVorlage;
ADDRESS COMMAND "copy" WWVorlage WWDokument;
/* Oberfläche sperren */
LOCKGUI;
/* Art ermitteln: 0 = Drucken, 1 = Vorschau, 2 = Speichern */
PRINTSTATE;
Druckart = MTR_RESULT;
Ende_Kennzeichen = 'N';
/* Suchen der zu druckenden Daten */
GET_PREFS;
PRINTFIND;
/* Neues Dokument öffnen */
ADDRESS VALUE WWPort;
NEW;
WWPort = RESULT;
ADDRESS VALUE ARexxPort;
DO WHILE( MTR_RESULT > 0 & Ende_Kennzeichen = 'N');
CALL DatenAufbereiten;
SELECT;
WHEN Druckart = 0 THEN /* Drucken */
DO;
ADDRESS VALUE WWPort;
PRINT;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
WHEN Druckart = 1 THEN /* Vorschau */
ADDRESS VALUE ARexxPort;
WHEN Druckart = 2 THEN /* Sichern */
DO;
ADDRESS VALUE WWPort;
SAVEAS;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
OTHERWISE
DO;
ADDRESS VALUE ARexxPort;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "Druckart wird nicht unterstützt!";
ES_GADGETFORMAT = "Ok";
EASY_REQUEST;
Ende_Kennzeichen = 'J';
END;
END;
PRINTFIND;
END;
/* WordWorth-Datei aus t: wieder entfernen */
ADDRESS COMMAND "delete" WWDokument;
/* Oberfläche wieder entsperren */
ADDRESS VALUE ARexxPort;
FREEGUI;
EXIT;
DatenAufbereiten:
ZW_Rechnung = IB.BILL_NUMBER;
IF IB.SUPPLIER.ADDRESS.BANK_CODE_NUMBER = "0" THEN
IB.SUPPLIER.ADDRESS.BANK_CODE_NUMBER = "";
/* Betrag korrekt formatieren, Währungssymbol separieren */
i = IB.CURRENCY_USED;
FORMAT_MONEY2 IB.TOTAL_M_ALL_CH.i;
j = index( MTR_RESULT, PREFS.CURRENCYSYMBOL );
l1 = j - 1;
l2 = LENGTH( MTR_RESULT ) - l1 - LENGTH( PREFS.CURRENCYSYMBOL );
IF i < 2 THEN
FORMAT_MONEY1 IB.TOTAL_M_ALL_CH.i;
ZW_Betrag = LEFT(LEFT(MTR_RESULT, l1) || RIGHT(MTR_RESULT, l2), 12);
ZW_WSymbol = LEFT(SUBSTR(MTR_RESULT, j, (LENGTH( MTR_RESULT ) - l1 - l2) ), 3);
IF IB.SUPPLIER.ADDRESS.COMPANY1 > "" THEN
ZW_Adresse = LEFT( (IB.SUPPLIER.ADDRESS.COMPANY1 || ", " || IB.SUPPLIER.ADDRESS.CITY), 27);
ELSE
ZW_Adresse = LEFT( (IB.SUPPLIER.ADDRESS.PRENAME IB.SUPPLIER.ADDRESS.SURNAME || ", " || IB.SUPPLIER.ADDRESS.CITY), 27);
ADDRESS VALUE WWPort;
OPEN FILENAME WWDokument FORCE;
POSITION SOF;
FINDCHANGE FIND "<RECEIVER.SUR_PRENAME>" CHANGE UPPER(ZW_Adresse);
POSITION SOF;
FINDCHANGE FIND "<R.ACCOUNT>" CHANGE UPPER(LEFT( IB.SUPPLIER.ADDRESS.ACCOUNT, 10 ));
POSITION SOF;
FINDCHANGE FIND "<R.BCM>" CHANGE UPPER(LEFT( IB.SUPPLIER.ADDRESS.BANK_CODE_NUMBER,8));
POSITION SOF;
FINDCHANGE FIND "<RECEIVER.BANK_NAME>" CHANGE UPPER(LEFT( IB.SUPPLIER.ADDRESS.BANK_NAME, 27 ));
POSITION SOF;
FINDCHANGE FIND "<W>" CHANGE UPPER(ZW_WSymbol);
POSITION SOF;
FINDCHANGE FIND "<B.TOTAL>" CHANGE UPPER(ZW_Betrag);
FINDCHANGE FIND "<B.TOTAL>" CHANGE UPPER(ZW_Betrag);
POSITION SOF;
FINDCHANGE FIND "<B.BILL_NUMBER>" CHANGE UPPER(ZW_Rechnung);
POSITION SOF;
ZW_Kunde = IB.SUPPLIER.CLIENT_CODE;
FINDCHANGE FIND "<REC.NUMBER>" CHANGE UPPER(ZW_Kunde);
POSITION SOF;
IF IB.OFFICE.ADDRESS.COMPANY1 > "" THEN
ZW_Adresse = LEFT( (IB.OFFICE.ADDRESS.COMPANY1 || ", " || IB.OFFICE.ADDRESS.CITY), 27);
ELSE
ZW_Adresse = LEFT( (IB.OFFICE.ADDRESS.PRENAME IB.OFFICE.ADDRESS.SURNAME || ", " || IB.OFFICE.ADDRESS.CITY), 27);
FINDCHANGE FIND "<SENDER.SUR_PRENAME>" CHANGE UPPER(ZW_Adresse);
POSITION SOF;
FINDCHANGE FIND "<S.ACCOUNT>" CHANGE UPPER(LEFT(IB.OFFICE.ADDRESS.ACCOUNT, 10));
RETURN;